home *** CD-ROM | disk | FTP | other *** search
- /*
- File: CAS_CTools.c
-
- Contains: InitTools. Also owns the tool GLOBALs.
-
- Written by: David H Nelson
-
- Copyright © 1988-1995 ComponentWorks, All rights reserved.
-
- Change History (most recent first):
-
- <1> 1988 DHN Created.
-
- */
-
- #define _CTOOLS_
-
- #include <GestaltEqu.h>
-
- #include "CAS_Globals.h"
- #include "CAS_CTools.h"
-
- #define kDragMgrTrap 0xABED
- #define kTEGetHiliteRgnTrap 0xA83D
-
-
- //---------------------------------------------------------------------------
- void InitTools(void)
- {
- OSErr theErr;
- long response;
-
- blockErase((Ptr)&firstGlobal, (&lastGlobal - &firstGlobal + sizeof(lastGlobal)) );
-
- // Check for System 7
- theErr = Gestalt( gestaltSystemVersion, &response );
- runningSystem7 = (!theErr && (response >= 0x0700));
-
- // Check for Color QuickDraw
- theErr = Gestalt( gestaltQuickdrawVersion, &response );
- hasColorQD = (!theErr && response >= gestalt8BitQD);
- has32BitQD = (!theErr && response >= gestalt32BitQD);
-
- // Check for the drag mgr
- // if gestalt fails the trap may still be implemented (System 7 Pro),
- // but the API for the trap is different so we don't work.
- theErr = Gestalt( gestaltDragMgrAttr, &response );
- hasDragMgr = (!theErr && (response & (1<<gestaltDragMgrPresent)) != 0);
-
- // Check for TEGetHiliteRgn
- theErr = Gestalt( gestaltTEAttr, &response );
- hasTEGetHiliteRgn = (!theErr && (response & (1<<gestaltTEHasGetHiliteRgn)) != 0);
- }
-
-